#include "fu_inter.h"
#include "string.h"
#include "ha_485.h"

void inter_hardware_init(void)
{
	rs485_init();
}

uint16_t get_uart4_data(uint8_t *p_buf)
{
	if(st_485.status == RECVEND){
		memcpy(p_buf,st_485.rx_buf,st_485.rx_cnt);
		st_485.status = DEALING;
		return st_485.rx_cnt;
	}
	return 0;
}

void send_uart4_data(uint8_t *p_buf,uint16_t len)
{
	rs485_send_data(p_buf,len);
}

void set_inter_rx_mode(void)
{
	rs485_to_rx_mode();
}
